package com.ruoyi.project.knowledge.metallographic.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.knowledge.metallographic.mapper.KnowledgeSytMetallographicSpectrumInfoMapper;
import com.ruoyi.project.knowledge.metallographic.domain.KnowledgeSytMetallographicSpectrumInfo;
import com.ruoyi.project.knowledge.metallographic.service.IKnowledgeSytMetallographicSpectrumInfoService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 金相图谱信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-27
 */
@Service
public class KnowledgeSytMetallographicSpectrumInfoServiceImpl implements IKnowledgeSytMetallographicSpectrumInfoService 
{
    @Autowired
    private KnowledgeSytMetallographicSpectrumInfoMapper knowledgeSytMetallographicSpectrumInfoMapper;

    /**
     * 查询金相图谱信息
     * 
     * @param id 金相图谱信息主键
     * @return 金相图谱信息
     */
    @Override
    public KnowledgeSytMetallographicSpectrumInfo selectKnowledgeSytMetallographicSpectrumInfoById(Long id)
    {
        return knowledgeSytMetallographicSpectrumInfoMapper.selectKnowledgeSytMetallographicSpectrumInfoById(id);
    }

    /**
     * 查询金相图谱信息列表
     * 
     * @param knowledgeSytMetallographicSpectrumInfo 金相图谱信息
     * @return 金相图谱信息
     */
    @Override
    public List<KnowledgeSytMetallographicSpectrumInfo> selectKnowledgeSytMetallographicSpectrumInfoList(KnowledgeSytMetallographicSpectrumInfo knowledgeSytMetallographicSpectrumInfo)
    {
        return knowledgeSytMetallographicSpectrumInfoMapper.selectKnowledgeSytMetallographicSpectrumInfoList(knowledgeSytMetallographicSpectrumInfo);
    }

    /**
     * 新增金相图谱信息
     * 
     * @param knowledgeSytMetallographicSpectrumInfo 金相图谱信息
     * @return 结果
     */
    @Override
    public int insertKnowledgeSytMetallographicSpectrumInfo(KnowledgeSytMetallographicSpectrumInfo knowledgeSytMetallographicSpectrumInfo)
    {
        knowledgeSytMetallographicSpectrumInfo.setCreateTime(DateUtils.getNowDate());
        return knowledgeSytMetallographicSpectrumInfoMapper.insertKnowledgeSytMetallographicSpectrumInfo(knowledgeSytMetallographicSpectrumInfo);
    }

    /**
     * 修改金相图谱信息
     * 
     * @param knowledgeSytMetallographicSpectrumInfo 金相图谱信息
     * @return 结果
     */
    @Override
    public int updateKnowledgeSytMetallographicSpectrumInfo(KnowledgeSytMetallographicSpectrumInfo knowledgeSytMetallographicSpectrumInfo)
    {
        return knowledgeSytMetallographicSpectrumInfoMapper.updateKnowledgeSytMetallographicSpectrumInfo(knowledgeSytMetallographicSpectrumInfo);
    }

    /**
     * 批量删除金相图谱信息
     * 
     * @param ids 需要删除的金相图谱信息主键
     * @return 结果
     */
    @Override
    public int deleteKnowledgeSytMetallographicSpectrumInfoByIds(String ids)
    {
        return knowledgeSytMetallographicSpectrumInfoMapper.deleteKnowledgeSytMetallographicSpectrumInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除金相图谱信息信息
     * 
     * @param id 金相图谱信息主键
     * @return 结果
     */
    @Override
    public int deleteKnowledgeSytMetallographicSpectrumInfoById(Long id)
    {
        return knowledgeSytMetallographicSpectrumInfoMapper.deleteKnowledgeSytMetallographicSpectrumInfoById(id);
    }
}
